function x = OpCholeskyDecomposition(A,n)
%OpCholeskyDecomposition 优化Cholesky分解LDL^T
%   此处显示详细说明
v = zeros(n,1);
for i = 2:n
   A(i,1) = A(i,1)/A(1,1); 
end
for j = 2:n
    for i = 1:j-1
        v(i) = A(j,i)*A(i,i);
    end
    A(j,j) = A(j,j) - A(j,1:j-1)*v(1:j-1);
    A(j+1:n,j) = (A(j+1:n,j) - A(j+1:n,1:j-1)*v(1:j-1))/A(j,j);
end
x = A;
end

